#include <stdio.h>

long long factorialSum(int num) {
    long long ret = 0;
    for (int i = 1; i <= num; i++) {
        long long  factorial = 1;
        for (int j = 1; j <= i; j++)
            factorial *= j;
        ret += factorial;
    }
    return ret;
}

int main() {
    long long res = factorialSum(20);
    printf("the factorial sum is : %lld\n", res);
    return 0;
}